package com.itany.corejava.code13_jdbc;

import java.util.ArrayList;
import java.util.List;

/**
 * @author MissChen
 * @date 2024年03月25日 8:50
 */
public class ClassBean {
    private Integer id;
    private String name;
    private String major;
    List<Student> students=new ArrayList<>();

    public void addStu(Student student){
        students.add(student);
    }
    public ClassBean() {
    }

    public ClassBean(String name, String major) {
        this.name = name;
        this.major = major;
    }

    public ClassBean(Integer id, String name, String major) {
        this.id = id;
        this.name = name;
        this.major = major;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    @Override
    public String toString() {
        return "ClassBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", major='" + major + '\'' +
                ", students=" + students +
                '}';
    }
}
